package Function.ItemUse;

import VWorldGameStudio.FCBattleOrder;
import VWorldGameStudio.FCMonster;
import VWorldGameStudio.FCPlayerInfo;
import VWorldGameStudio.FCTank;

import static FCRendering.FCRMaster.fcv;
import static FCRendering.FCRMaster.langLib;

public class ToolShiLa extends AItemUse{
    @Override
    public ItemUseResult directUse() {
        return useForTankTarget(keepItemTank);
    }

    @Override
    public ItemUseResult useInMapTarget(int x, int y) {
        return new ItemUseResult().useless();
    }

    @Override
    public ItemUseResult useForMonsterTarget(FCBattleOrder battleOrder, FCMonster m) {
        return new ItemUseResult().useless();
    }

    @Override
    public ItemUseResult useForPlayerTarget(FCPlayerInfo p) {
        return useForTankTarget(keepItemTank);
    }

    @Override
    public ItemUseResult useForTankTarget(FCTank t) {
        fcv.closeAllShowWindw();
        if(t == null){
            fcv.getMessage().add("只能对坦克使用!");
            fcv.showMessage();
            return new ItemUseResult().useless();
        }
        t.setAcidState(false);
        fcv.getMessage().add("对"+langLib.getNameOfId(t.getName())+"使用了石蜡");
        fcv.showMessage();
        useAfter();
        return new ItemUseResult();
    }
}
